package com.ledim.widget.viewPager;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;

/**
 * viewPager基类
 *
 * @author zhuqiao
 */
public class LetvBaseViewPager extends ViewPager {

    protected Context mContext;

    public LetvBaseViewPager(Context context) {
        this(context, null);
    }

    public LetvBaseViewPager(Context context, AttributeSet attrs) {
        super(context, attrs);
        mContext = context;
    }

    /**
     * 跳转到下一个
     */
    public void next() {
        int next = super.getCurrentItem() + 1;
        if (getAdapter() != null && getAdapter().getCount() > next) {
            this.setCurrentItem(next, true);
        }
    }

}
